/*
 * @lc app=leetcode.cn id=9 lang=javascript
 *
 * [9] 回文数
 */

// @lc code=start
/**
 * @param {number} x
 * @return {boolean}
 */
var isPalindrome = function (x) {
    if(x<0)return false
    if (0<=x &&x< 10) return true
    let now = String(x)
    let len=now.length
    let index
    for(index=0;index<len/2;index++){
        if(now[index]!=now[len-1-index]){
            return false
        }
    }
    return true
};

// @lc code=end
a = isPalindrome(1221)
console.log(a)
